<template>
  <el-dialog
    title="试题审核"
    :visible.sync="showDialog"
    width="30%"
  >
    <span></span>
    <el-form
      :model="form"
      ref="form"
      label-width="80px"
      :inline="false"
      size="normal"
    >
      <el-form-item label="审核结果">
        <el-radio-group v-model="form.check_state">
          <el-radio label="通过"></el-radio>
          <el-radio label="不通过"></el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item label="审核意见">
        <el-input type="textarea" v-model="form.check_remarks"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="btnOK">确定</el-button>
        <el-button @click="showDialog=false">取消</el-button>
      </el-form-item>
    </el-form>
  </el-dialog>
</template>

<script>
import { checkQuestion } from "@/api/exam";
export default {
  name: "checkDialog",
  created() {},
  data() {
    return {
      showDialog: false,
      form: {
        check_state: "通过",
        check_remarks: "",
      },
    };
  },
  methods: {
    btnOK() {
      
      this.checkQuestion();
      // console.log(this.form.id);
      this.$message.success("提交成功");
      this.showDialog = false;
      this.$emit("initData");
    },
    async checkQuestion() {
      await checkQuestion(this.form);
    },
  },
};
</script>

<style></style>
